######################################
# Django 模块
######################################
from django import forms


######################################
# 自定义模块
######################################
from .models import *


######################################
# 创建单个固定注册码
######################################
class SingleTokenForm(forms.Form):
    version = forms.CharField(max_length=1,required=True)
    type = forms.CharField(required=True)
    token = forms.CharField(max_length=20, min_length=2, required=True)
    name = forms.CharField(max_length=20, min_length=2, required=True)
    money = forms.IntegerField(required=True)

######################################
# 创建随机注册码
######################################
class IndexTokenForm(forms.Form):
    version = forms.CharField(max_length=1,required=True)
    type = forms.CharField(required=True)
    count = forms.IntegerField(required=True)
    name = forms.CharField(max_length=20, min_length=2, required=True)
    money = forms.IntegerField(required=True)

######################################
# 创建序列注册码
######################################
class DiyTokenForm(forms.Form):
    version = forms.CharField(max_length=1, required=True)
    type = forms.CharField(required=True)
    diycode = forms.CharField(required=True)
    count = forms.IntegerField(required=True)
    name = forms.CharField(max_length=20, min_length=2, required=True)
    money = forms.IntegerField(required=True)


######################################
# 注册码续费
######################################
class TokenAddTimeForm(forms.Form):
    token = forms.CharField(required=True)
    type = forms.CharField(required=True)

######################################
# 配额转让
######################################
class TokenTransferForm(forms.Form):
    type = forms.CharField(required=True)
    count = forms.IntegerField(required=True)
    name = forms.CharField(max_length=20, min_length=2, required=True)
    username = forms.CharField(required=True)
    money = forms.IntegerField(required=True)